Removes combs from 1 bit images. A comb is a horizontal line with vertical marks at uniform spaces. Text that intersects part of the comb will be reconstructed.
→
The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.
This opcode can be instructed to operate on a subset of the image using the RectX/Y/Width/Height parameters of the SCANFIX by setting the PF2_ActOnRectangle flag.
Padding pixels present at the end of each line may be modified by this operation.
This operation relies primarily on three parameters to select the areas to remove: minimum area width, minimum area height, and maximum dot size. All three criteria must be true of an area for it to be removed.
- Subcode is set to SF_SUBCODE_REMOVE_COMBS (23).
- PicFlags2 is set to PF2_ActOnRectangle if the operation should be limited to the region specified in RectX, RectY, RectWidth, and RectHeight. Although the operation can be limited to a subrectangle of the entire image, the output of the opcode will always be the full image.
- u.SC23.MinimumCombLength is set to a value that indicates the minimum length of an individual comb, in pixels. Combs smaller than this length will not be removed. Valid values are 10 to 2,147,483,647, with the best value being a little lower than the length of the smallest comb present in an actual document.
- u.SC23.CombHeight is set to the typical height of a comb, in pixels. Valid values are from 4 to 1000, with the best value being the average height of a comb (measured from the top of the horizontal line to the top of the vertical line.)
- u.SC23.CombSpacing is set to the typical spacing, in pixels, between the vertical marks that comprise a comb. Valid values are from 10 to 1000, with the best value being the average distance between adjacent vertical marks of a comb.
- u.SC23.HorizontalLineThickness is set to the typical thickness, in pixels, of the horizontal portion of a comb. Valid values are from 1 to 20 , with 5 being a good default.
- u.SC23.VerticalLineThickness is set to the typical thickness, in pixels, of the vertical marks of a comb. Valid values are from 1 to 20 , with 5 being a good default value.
- u.SC23.MinimumConfidence is set to the minimum confidence for an individual comb. Internally, the opcode computes a confidence for each comb. Combs with confidences equal to or above this value will be removed, while combs with confidences below this value will remain. Valid values are from 1 to100, with 100 being a good default value.
- Stride is set to the image line width in bytes including padding at the end of the line width or to 0. If Stride is 0 and PF_NoDibPad is set in PicFlags, the operation will compute the stride using: [ (PixelWidth*BitCount)/8 ]. If Stride is 0 and PF_NoDibPad is not set in PicFlags, the operation will compute the stride using: [ (((PixelWidth*BitCount)+31)&(~31))/8 ].
In addition to placing an output image into the Put Queue, this operation stores some output information into the PIC_PARM structure in the following locations.
- CountOfFeaturesDetected is set, during REQ_EXEC, to the number of areas removed.
- OutputStride is set, during REQ_INIT and REQ_EXEC, to the image line width in bytes including padding at the end of the line.
- BiOut is set, during REQ_INIT and REQ_EXEC, to the attributes of the output image. Since this operation does not adjust the size of the image, BiOut will be set to a copy of the Head structure within PIC_PARM.
If the ReportingDatafield is set to point to a ScanFixReportDatainstance, then the defer function will be called with a value of RES_QUERYfor every comb detected in the image. The ScanFixReportData.Subcode will be set to SF_SUBCODE_REMOVE_COMBS, and ScanFixReportData.u.ComData will contain information about the currently selected comb. If the comb is to be deleted, then ScanFixReportData.u.CombData.DeleteCombshould be set to a non-zero value. If ScanFixReportData.Stopis set to a non-zero value, then the defer function will not be called for any subsequent combs in the image, and all remaining combs will be left in the image.